import axiosServer from '@/utils/request'

/**
 * 首页分类列表
 */
export const requestCategoryList=()=>{
    return axiosServer({
        method:'get',
        url:'http://kumanxuan1.f3322.net:8001 '
    })
}


/**
 * 商品列表
 */
export const requestProductList=(pageSize,pageNo)=>{
    return axiosServer({
        method:'get',
        url:'/api/shop/list',
        params:{
            pageSize,
            pageNo
        }
    })
}

/**
 * 商品详情
 */
export const requestProductDetail=(id)=>{
    return axiosServer({
        method:'get',
        url:'/api/shop/find',
        params:{
            id
        }
    })
}


/**
 * 获取商品评论
 */
export const requestProductSpeak=(id)=>{
    return axiosServer({
        method:'get',
        url:'/api/shop/comment/list',
        params:{
            productId:id
        }
    })
}

/**
 * 添加商品评论
 */
export const requestAddProductSpeak=(message,userId,productId )=>{
    return axiosServer({
        method:'post',
        url:'/api/shop/comment/add',
        data:{
            message,
            userId,
            productId 
        }
    })
}